<?php $this->load->view('scenic/layout/header') ?>
<header class="my-head flex">
    <div class="my-return">
        <a href="javascript:goHistoryBack('<?php echo site_url('scenic/order/index'); ?>');">
            <i class="iconfont">&#xe606;</i>
        </a>
    </div>
    <div class="add-name">
        订单详情
    </div>
    <div class="pay-option flex">
        <a href="<?php echo site_url(); ?>">
            <i class="iconfont">&#xe605;</i>
        </a>
        <a href="tel:400-0571-648">
            <i class="iconfont pay-phone">&#xe61d;</i>
        </a>
    </div>
</header>
<section class="detail-text widthMax">
    <div class="detail-head">
        <h6>
            下单时间：<?php echo date('Y-m-d H:i:s', $orderInfo->ordertime); ?>
        </h6>
        <div class="detail-label">
            <div class="tion-state flex">
                <h4 class="flex-1">
                    <?php 
                        if (((int)$orderInfo->bit_pay & 65536) == 65536)
                        {
                            if ($orderInfo->bit_use)
                            {
                                echo '已检票';
                            }
                            elseif (((int)$orderInfo->bit_opt& 128) == 128)
                            {
                                echo '退票审核中';
                            }
                            else
                            {
                                echo '已付';
                            }
                        }
                        else
                        {
                            if (((int)$orderInfo->bit_wan & 8) == 8)
                            {
                                echo '景区到付';
                            }
                            else
                            {
                                echo '未支付';
                            }
                        }
                    ?>
                </h4>
                <div class="tion-price">
                    订单金额：<i><span>￥</span><?php echo $orderInfo->amount_fee; ?></i>
                </div>
            </div>
            <div class="tion-pave">
                订单号：<?php echo $orderInfo->order_id; ?>
            </div>
            <?php if ($orderInfo->other_id > 0): ?>
                <div class="tion-pave">
                    它网单号：<?php echo $orderInfo->other_id; ?>
                </div>
            <?php endif; ?>
        </div>
    </div>
    <div class="detail-tion">
        <h3><?php echo $orderInfo->goods_name; ?></h3>
        <p><?php echo date('Y-m-d', $orderInfo->plantime); ?></p>
        <ul class="tion-ul">
            <li>
                <h5>取票人：</h5>
                <p class="flex-1"><?php echo $orderInfo->play_name; ?></p>
            </li>
            <li>
                <h5>身份证：</h5>
                <p class="flex-1"><?php echo substr_sfz($orderInfo->sfz); ?></p>
            </li>
            <li>
                <h5>联系电话：</h5>
                <p class="flex-1"><?php echo subStrMobilePhone($orderInfo->phone); ?></p>
            </li>
            <li>
                <h5>购买份数：</h5>
                <p class="flex-1">
                <?php if ($orderInfo->number){
                    echo '￥', bcdiv($orderInfo->amount_fee, $orderInfo->number, 2), 'x', $orderInfo->number, '份'; 
                } elseif ($orderInfo->number) {
                    echo '￥', bcdiv($orderInfo->amount_fee, $orderInfo->goods_num, 2), 'x', $orderInfo->goods_num, '份';
                } else {
                    echo '￥0 x 0份';
                }?>
                </p>
            </li>
            <?php if ($orderInfo->calculate_method == 3 && (((int)$orderInfo->bit_pay & 65536) == 65536) && 0 == (((int)$orderInfo->bit_opt & 128)) && $orderInfo->goods_num > 0) : ?>
            <li class="voucher">
                    <h5>入园凭证：</h5>
                    <div class="order-code">
                        <img src="<?php echo $this->config->show_image_url('scenic-'. $orderInfo->order_id.'.png', '', 'qrcode');?>">
                        <p>请向工作人员展示二维码入园</p>
                    </div>
                </li>
            <?php endif; ?>
        </ul>
    </div>
</section>

<?php if (((int)$orderInfo->bit_pay & 65536) != 65536) : ?>
<footer class="detail-foot">
    <a href="<?php echo site_url('scenic/payment/payOrderScenic/'.$orderInfo->pay_id); ?>">去支付</a>
</footer>
<?php endif; ?>

<div class="detail-erwm am-modal" tabindex="-1" id="doc-modal-1">
     <img src="<?php echo $this->config->show_image_url('scenic-'. $orderInfo->order_id.'.png', 'qrcode');?>">
</div>

<?php $this->load->view('scenic/layout/footer'); ?>